package com.weng.bigdata.micro.service.message.center.feign;

import com.weng.bigdata.micro.service.common.ServicesConstants;
import com.weng.bigdata.micro.service.message.center.fallback.MessageFallBack;
import com.weng.bigdata.micro.service.message.center.model.MailMessageDto;
import com.weng.bigdata.micro.service.message.center.model.MqMessageDto;
import com.weng.bigdata.micro.service.message.center.model.SmsMessageDto;
import com.weng.framework.core.model.ResponseData;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.PostMapping;

/**
 * 数仓任务接口
 *
 * @author wengzhonghui
 * @date 11:15 2021/4/2
 */
@FeignClient(name = ServicesConstants.MESSAGE_CENTER_API_SERVER_NAME, fallback = MessageFallBack.class, configuration = MessageFallBack.class)
public interface MessageFeignService {

    String URL_PREFIX = "/message";

    /**
     * 发送Mq消息
     *
     * @param message
     * @return
     */
    @PostMapping(URL_PREFIX + "/mq/send")
    ResponseData sendMqMessage(MqMessageDto message);

    /**
     * 发送短信消息
     *
     * @param message
     * @return
     */
    @PostMapping(URL_PREFIX + "/sms/send")
    ResponseData sendSmsMessage(SmsMessageDto message);

    /**
     * 发送邮件消息
     *
     * @param message
     * @return
     */
    @PostMapping(URL_PREFIX + "/mail/send")
    ResponseData sendMailMessage(MailMessageDto message);

}
